package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import tech.aistar.entity.Message;

import java.util.List;

public interface MessageMapper {
    @Select("select * from message where register_id=#{registerId}")
    List<Message> selectAll(Integer registerId);


    @Insert("insert into message values(registerId,messageContent,messageType,responseTime,identity)")
    void insert(MessageMapper message);
    @Update("update message set register_id=#{registerId},message_content=#{messageContent}" +
            ",message_type=#{messageType},response_time=#{responseTime},identity=#{identity} where id=#{Id}")
    void  updateByPrimaryKey(MessageMapper message);

    @Delete("delete from message where id=#{id}")
    void deleteByPrimaryKey(Integer id);

    @Update("update Message set message_type=2 where id=#{id}")
    int updatetypeById(Integer id);

    @Delete("delete from message where id=#{id}")
    int deleteById(Integer id);

}
